/***
 * File  	: SnowflakeView.java
 * Subject	: Extends GLSurfaceView to create a drawing surface
 * Author 	: Isaac Parenteau
 * Date		: March 30th, 2010
 */
package src.project.koch;

import android.content.Context;
import android.opengl.GLSurfaceView;
import android.view.MotionEvent;

public class SnowflakeView extends GLSurfaceView{
	
	private SnowflakeRenderer _renderer;
	
	public SnowflakeView(Context context) {
		super(context);
		
		_renderer = new SnowflakeRenderer();
		setRenderer(_renderer);
	}
	
	public SnowflakeRenderer GetRenderer()
	{
		return _renderer;
	}
	
	public boolean onTouchEvent(final MotionEvent event){
		queueEvent(new Runnable(){

			@Override
			public void run() {
				
				_renderer.ChangeBackgroundColor(event.getX() / getWidth(), 
						event.getY() / getHeight(), event.getX() / event.getY());				
				}
			
		});
		return true;
	} 
}

